package com.lj.boss.service.impl;




import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.lj.boss.commons.result.PageInfo;
import com.lj.boss.commons.utils.JsonUtils;
import com.lj.boss.dal.daointerface.ExamRecordMapper;
import com.lj.boss.model.student.ExamRecord;
import com.lj.boss.service.student.IExamRecordService;
@Service
public class ExamRecordServiceImpl  extends ServiceImpl<ExamRecordMapper, ExamRecord> implements IExamRecordService {
	private Logger logger=LoggerFactory.getLogger(ExamRecordServiceImpl.class);
	@Autowired
   private  ExamRecordMapper examRecordMapper;

	
	public List<ExamRecord> selectTreeGrid() {
		EntityWrapper<ExamRecord> wrapper = new EntityWrapper<ExamRecord>();
        wrapper.orderBy("seq");
		return examRecordMapper.selectList(wrapper);
	}

	@Override
	public void selectDataGrid(PageInfo pageInfo) {
		Page<Map<String, Object>> page = new Page<Map<String, Object>>(pageInfo.getNowpage(), pageInfo.getSize());
        page.setOrderByField(pageInfo.getSort());
        page.setAsc(pageInfo.getOrder().equalsIgnoreCase("asc"));
        List<Map<String, Object>> list = examRecordMapper.selectExamRecordPage(page, pageInfo.getCondition());
        logger.info("list="+JsonUtils.toJson(list));
        pageInfo.setRows(list);
        pageInfo.setTotal(page.getTotal());
        logger.info("pageInfo="+JsonUtils.toJson(pageInfo));
		
	}

	


	
	
   
	

}
